/*
 * @Author: libing 9852442+liu-sheng-8667@user.noreply.gitee.com
 * @Date: 2024-05-22 21:29:31
 * @LastEditors: xuezhuangzhuang xzz6996@qq.com
 * @LastEditTime: 2025-04-22 21:20:07
 * @FilePath: \crm\apis\order\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { service } from "@/config/request";

// 订单列表
export function getOrderList(params = {}) {
  return service({
    path: "/pigx-mall/mallOrder/listMallOrderPage",
    params,
    method: "get",
  });
}
// 订单详情
export function getOrderListid(id) {
  return service({
    path: `/pigx-mall/mallOrder/getById/${id}`,
    // params,
    method: "get",
  });
}

export function getOrderListid1(params) {
  return service({
    path: `/pigx-logistics/logisticsOrder/page`,
    params,
    method: "get",
  });
}

// /api/pigx-logistics/logisticsOrder/page

// 拍照下单列表
export function getPhotoOrderList(params = {}) {
  return service({
    // /api/customer/orderPoto/orderPotoPageCrm?current=1&size=10
    path: "/customer/orderPoto/orderPotoPageCrm",
    // path: "/pigx-mall/mallOrderPoto/listMallOrderPotoPage",
    params,
    method: "get",
  });
}

// 添加拍照下单
export function addPhotoOrder(params = {}) {
  return service({
    // path: "/customer/orderPoto/save",
    path: "/pigx-mall/mallOrderPoto/saveCrm",
    params,
    method: "post",
    header: {
      "Content-Type": "application/json; charset=UTF-8",
    },
  });
}

// 拍照订单-----详情
export function getPhotoOrderInfo(id) {
  return service({
    url: `/pigx-mall/mallOrderPoto/detail/${id}`,
    method: "get",
  });
}

// 新增收货地址
export function addAddress(params = {}) {
  return service({
    url: `/pigx-mall/mallOrderReceiveAddress/save`,
    method: "post",
    params,
    header: {
      "Content-Type": "application/json; charset=UTF-8",
    },
  });
}

// 获取收货地址
export function getAddressList(params = {}) {
  return service({
    url: "/pigx-mall/mallOrderReceiveAddress/page",
    method: "get",
    params,
    header: {
      "Content-Type": "application/json; charset=UTF-8",
    },
  });
}

// 删除收货地址
export function delAddress(params) {
  return service({
    url: "/pigx-mall/mallOrderReceiveAddress/removeById",
    method: "delete",
    params,
    header: {
      "Content-Type": "application/json; charset=UTF-8",
    },
  });
}

// 修改收货地址
export function updateAddress(params = {}) {
  return service({
    url: "/pigx-mall/mallOrderReceiveAddress/updateById",
    method: "put",
    params,
    header: {
      "Content-Type": "application/json; charset=UTF-8",
    },
  });
}

export function listMallOrderPageTraft(params = {}) {
  return service({
    url: "/pigx-mall/mallOrder/listMallOrderPageTraft",
    method: "get",
    params,
    header: {
      "Content-Type": "application/json; charset=UTF-8",
    },
  });
}

export function reqGuarantee(params = {}) {
  return service({
    url: `/pigx-mall/mallOrder/guarantee/${params.orderId}?remark=${params.remark}`,
    method: "put",
    header: {
      "Content-Type": "application/json; charset=UTF-8",
    },
  });
}
